﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Backend.Data.Managers;
using Backend.Data.Entities;
using System.Diagnostics;

namespace Backend.Data.Tests.Managers
{
    [TestClass]
    public class LegalEntityMangerTest
    {


        [TestMethod]
        public void TestGetListByFilter()
        {
            Debug.WriteLine("  HOOOLA !! ");
            var lista = LegalEntityManager.GetListByFilter("");
            Debug.WriteLine("  Tam lista " + lista.Count);

            Assert.IsTrue(lista.Count > 0);
        }


        [TestMethod]
        public void TestCreate()
        {
            LegalEntity d = new LegalEntity()
            {
                Name = "Nelyda",
                Alias = "Chikilina",
                Code = "200920454",
                LegalName = "200920454",
                Logo = "jojojo "
                    
            };
            var comprobanteDB = LegalEntityManager.Create(d);
            Assert.IsTrue(comprobanteDB.Id != Guid.Empty);
        }

        [TestMethod]
        public void Delete()
        {
            Guid id = new Guid("a86c72c6-4c09-e511-805a-64510602c72a");
            LegalEntityManager.Delete(id);
        }

        [TestMethod]
        public void UpdateTest()
        {
            Guid id = new Guid("826d3978-4a09-e511-805a-64510602c72a");
            LegalEntity legalEntity = LegalEntityManager.GetById(id);
            legalEntity.Name = " LOKA ZAPANA !!  ";
            LegalEntityManager.Update(legalEntity);

        }








    }
}
